package cn.credit.loan.service.manager;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.credit.loan.dao.manager.ManagerMapper;
import cn.credit.loan.entity.Manager;
@Service
@Transactional
public class ManagerServiceImpl implements ManagerService {
	@Autowired
	private ManagerMapper managerMapper;
	/**
	 * 业务经理登录
	 */
	@Override
	public Manager managerlogin(String managerName, String managerPwd)throws Exception {
		if(managerName.trim()!=null && managerPwd.trim()!=null)
		{
			Manager manager=managerMapper.managerlogin(managerName, managerPwd);
			if(manager!=null){
				return manager;
			}
		}
		return null;
	}
	/**
	 * 业务经理添加
	 */
	@Override
	public boolean manageradd(Manager manager) throws Exception {
		if(manager!=null)
		{
			int num=managerMapper.manageradd(manager);
			if(num>0){
				return true;
			}
		}
		return false;
	}
	/**
	 * 业务经理更新
	 */
	@Override
	public boolean managerupdate(Manager manager) throws Exception {
		if(manager!=null)
		{
			int num=managerMapper.managerupdate(manager);
			if(num>0){
				return true;
			}
		}
		return false;
	}
	/**
	 * 业务经理删除
	 */
	@Override
	public boolean managerdelete(int managerId) throws Exception {
		return managerMapper.managerdelete(managerId);
	}
	

}
